package com.tamtamy.jtta.data.json;

import net.sf.json.JSONObject;

import com.tamtamy.jtta.data.UserDetail;
import com.tamtamy.jtta.utility.JSONUtility;

public class JSONUserDetail extends UserDetail {

	public JSONUserDetail(JSONObject jsonObject) {	
		this.userID = JSONUtility.getString(jsonObject, "userID");
		this.nickname = JSONUtility.getString(jsonObject, "nickname");
		this.firstName = JSONUtility.getString(jsonObject, "firstName");
		this.lastName = JSONUtility.getString(jsonObject, "lastName");
		this.birthday = JSONUtility.getString(jsonObject, "birthday");
		this.gender = JSONUtility.getString(jsonObject, "gender");
		this.diskQuotaLimit = JSONUtility.getString(jsonObject, "diskQuotaLimit");
		this.company = JSONUtility.getString(jsonObject, "company");
		this.mail = JSONUtility.getString(jsonObject, "mail");
		this.jabberMessenger = JSONUtility.getString(jsonObject, "jabberMessenger");
		this.msnMessenger = JSONUtility.getString(jsonObject, "msnMessenger");
		this.instantMessenger = JSONUtility.getString(jsonObject, "instantMessenger");
		this.blog =JSONUtility.getString(jsonObject, "blog");
		this.interest = JSONUtility.getString(jsonObject, "interest");
		this.avatarFilename = JSONUtility.getString(jsonObject, "avatarFilename");
		this.online = Boolean.parseBoolean(JSONUtility.getString(jsonObject, "online"));
		this.department = JSONUtility.getString(jsonObject, "department");
		this.contentList = JSONUtility.getStringList(jsonObject, "contentList");
		this.tagList = new JSONTagList(jsonObject, "tagList");
	}
}
